package com.canlihao.ui.utils.glide;

import android.widget.ImageView;

public class GlideConfig {
    private ImageView imageView;

    private String url;

    private int placeHold;

    //是否开启缓存；
    boolean cachs = true;

    public ImageView getImageView() {
        return imageView;
    }

    public String getUrl() {
        return url;
    }

    public int getPlaceHold() {
        return placeHold;
    }

    public boolean isCachs() {
        return cachs;
    }

    private GlideConfig(GlideBuider glideBuider) {
        this.cachs=glideBuider.cachs;
        this.imageView=glideBuider.imageView;
        this.url=glideBuider.url;
        this.placeHold=glideBuider.placeHold;
    }


    public static GlideBuider builder() {
        return new GlideBuider();
    }


    public static class GlideBuider {
        protected ImageView imageView;
        protected String url;
        protected boolean cachs=true;
        protected int placeHold;
        private GlideBuider() {
        }

        public GlideBuider img(ImageView imageView) {
            this.imageView = imageView;
            return this;
        }

        public GlideBuider placeHold(int placeHold) {
            this.placeHold = placeHold;
            return this;
        }

        public GlideBuider url(String url) {
            this.url = url;
            return this;
        }

        public GlideBuider cachs(boolean cachs) {
            this.cachs = cachs;
            return this;
        }

       public GlideConfig buider(){
            return new GlideConfig(this);
        }
    }

}
